// 2. 创建 reducer
const countReducer = (state = { count : 100 },action) =>{
    const {type,payload} = action
    switch (type) {
        case "add":
            return {...state,count:state.count + 1 }

        case "addNum":
            return {...state,count:state.count + payload}
        default:

            return state
    }
}

export default countReducer